(function(){
	"use strict"
	var $userNameEL,
		$lastLoginTimeEL,
		$lastLoginIpEL,
		$onlineUserEL,
		$totalAccountEL,
		$cpuPayloadEL,
		$memoryPayloadEL
	;	
		
		
	$(function(){
		var uc=JSON.parse(sessionStorage.getItem("user"));
		$userNameEL=$("#userNameEL");
		$lastLoginTimeEL=$("#lastLoginTimeEL");
		$lastLoginIpEL=$("#lastLoginIpEL");
		
		$onlineUserEL=$("#onlineUserEL");
		$totalAccountEL=$("#totalAccountEL");
		$cpuPayloadEL=$("#cpuPayloadEL");
		$memoryPayloadEL=$("#memoryPayloadEL");
		
		statistics();
	})
	
	var statistics=function(){
		var url="/api/system/statistics";
		$.get(url,function(resp){
			if(resp.code==="ok"){
				$onlineUserEL.text(resp.data.onlineUsers);
				$totalAccountEL.text(resp.data.totalAccount);
				$cpuPayloadEL.text(resp.data.cpuPayload+"%");
				$memoryPayloadEL.text(resp.data.memoryPayload+"%");
			}
		})
	};
})()
